<!DOCTYPE html>
<html lang='zh-cn'>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <title>测试1-任务列表 - 禅道</title>

    <script>window.config = {
        "webRoot": "\/zentao\/",
        "debug": false,
        "appName": "",
        "cookieLife": 30,
        "requestType": "PATH_INFO",
        "requestFix": "-",
        "moduleVar": "m",
        "methodVar": "f",
        "viewVar": "t",
        "defaultView": "html",
        "themeRoot": "\/zentao\/theme\/",
        "currentModule": "project",
        "currentMethod": "task",
        "clientLang": "zh-cn",
        "requiredFields": "",
        "router": "\/zentao\/index.php",
        "save": "\u4fdd\u5b58",
        "runMode": "",
        "timeout": 30000,
        "pingInterval": ""
    };
    window.lang = {
        "submitting": "\u7a0d\u5019...",
        "save": "\u4fdd\u5b58",
        "expand": "\u5c55\u5f00\u5168\u90e8",
        "timeout": "\u8fde\u63a5\u8d85\u65f6\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u73af\u5883\uff0c\u6216\u91cd\u8bd5\uff01"
    };
    </script>
    <script>config.onlybody = "no";</script>
    <link rel='stylesheet' href='../css/zh-cn.default.css' type='text/css' media='screen'/>
    <script src='../js/all.js'></script>
    <style>.mgr-5px {
        margin-right: 5px;
    }

    #productsBox .col-sm-3 {
        margin-bottom: 5px;
    }

    #productsBox .input-group {
        table-layout: fixed;
        width: 100%;
    }

    #productsBox .has-branch select {
        width: 100%;
        display: table-cell;
        border-radius: 0 2px 2px 0;
        border-left: none;
    }

    #productsBox .has-branch select:focus {
        box-shadow: inset 1px 0 #4d90fe
    }

    #productsBox .input-group-addon {
        display: none;
    }

    #productsBox .input-group.has-branch > select[name*="product"] + .chosen-container {
        width: 60% !important;
    }

    #productsBox .input-group.has-branch > select[name*="branch"] + .chosen-container {
        width: 40% !important;
    }

    #productsBox .input-group.has-branch > select[name*="product"] + .chosen-container .chosen-single {
        border-radius: 2px 0 0 2px;
    }

    #productsBox .input-group.has-branch > select[name*="branch"] + .chosen-container .chosen-single {
        border-radius: 0 2px 2px 0;
        border-left-width: 0;
        padding-left: 9px;
    }

    #productsBox .input-group.has-branch > select[name*="branch"] + .chosen-container.chosen-container-active .chosen-single {
        border-left-width: 1px;
        padding-left: 8px;
    }

    .table-children {
        border-left: 2px solid #cbd0db;
        border-right: 2px solid #cbd0db;
    }

    .table tbody > tr.table-children.table-child-top {
        border-top: 2px solid #cbd0db;
    }

    .table tbody > tr.table-children.table-child-bottom {
        border-bottom: 2px solid #cbd0db;
    }

    .table td.has-child > a:not(.task-toggle) {
        max-width: 90%;
        max-width: calc(100% - 30px);
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table td.has-child > .task-toggle {
        color: #838a9d;
        position: relative;
        top: 1px;
        line-height: 16px;
    }

    .table td.has-child > .task-toggle:hover {
        color: #006af1;
        cursor: pointer;
    }

    .table td.has-child > .task-toggle > .icon {
        font-size: 16px;
        display: inline-block;
        transition: transform .2s;
        -ms-transform: rotate(-90deg);
        -moz-transform: rotate(-90deg);
        -o-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
    }

    .table td.has-child > .task-toggle > .icon:before {
        text-align: left;
    }

    .table td.has-child > .task-toggle.collapsed {
        top: 2px
    }

    .table td.has-child > .task-toggle.collapsed > .icon {
        -ms-transform: rotate(90deg);
        -moz-transform: rotate(90deg);
        -o-transform: rotate(90deg);
        -webkit-transform: rotate(90deg);
        transform: rotate(90deg);
    }

    .main-table tbody > tr.table-children > td:first-child::before {
        width: 3px;
    }

    @-moz-document url-prefix() {
        .main-table tbody > tr.table-children > td:first-child::before {
            width: 4px;
        }
    }

    .chosen-container-single .chosen-single > span {
        max-width: 300px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    #whitelistBox .checkbox-inline, #whitelistBox .radio-inline {
        margin-left: 10px;
        display: inline-block;
        padding-left: 0px;
        padding-right: 10px;
    }

    .main-table > .table-responsive {
        padding: 0 1px;
        background: #fff;
    }

    td.delayed {
        background: #e84e0f !important;
        color: white;
    }

    #int-dropdown {
        margin-left: -8px;
        border-radius: 4px;
        border: 1px solid #0c64eb
    }

    #projectTaskForm table tbody tr td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    </style>
    <link rel='icon' href='../image/favicon.ico' type='image/x-icon'/>
    <link rel='shortcut icon' href='../image/favicon.ico' type='image/x-icon'/>
    <!--[if lt IE 10]>
    <script src='../js/min.js'></script>
    <![endif]-->
</head>
<body>
<style>
    .picker-single .picker-selection-remove {
        z-index: 1000;
    }

    .picker-selection-single:after, .picker-multi.picker-focus .picker-selections:before {
        font-family: ZentaoIcon !important;
        content: '\f0d7' !important;
    }
</style>
<script>
    var chooseUsersToMail = '选择要发信通知的用户...';
    if ($.fn.picker) {
        $(document).ready(function () {
            $(".picker-select[data-pickertype!='remote']").picker({chosenMode: true});
            $("[data-pickertype='remote']").each(function () {
                var pickerremote = $(this).attr('data-pickerremote');
                $(this).picker({chosenMode: true, remote: pickerremote});
            })
        });
    }
</script>
<header id='header'>
    <div id='mainHeader'>
        <div class='container'>
            <hgroup id='heading'>
                <h1 id='companyname' title='易软天创'><a href='/temp/index'>易软天创</a>
                </h1>
            </hgroup>
            <nav id='navbar'>
                <ul class='nav nav-default'>
                    <li data-id='my'><a href='/temp/index'><span> 我的地盘</span></a></li>
                    <li data-id='product'><a href='/temp/product-index-no'>产品</a></li>
                    <li class='active' data-id='project'><a href='/temp/project-index-no' class='active'>项目</a></li>
                    <li data-id='qa'><a href='/temp/product-showErrorNone-qa'>测试</a></li>
                    <li class='divider'></li>
                    <li data-id='ci'><a href='/temp/repo-browse'>集成</a></li>
                    <li data-id='doc'><a href='/temp/doc'>文档</a></li>
                    <li data-id='report'><a href='/temp/report-productSummary'>统计</a></li>
                    <li class='divider'></li>
                    <li data-id='company'><a href='/temp/company-browse'>组织</a></li>
                    <li data-id='admin'><a href='/temp/admin'>后台</a></li>
                </ul>
            </nav>
            <div id='toolbar'>
                <div id="userMenu">
                    <div id='searchbox'>
                        <div class='input-group'>
                            <div class='input-group-btn'><a data-toggle='dropdown' class='btn btn-link'><span
                                    id='searchTypeName'>项目</span> <span class='caret'></span></a><input type='hidden'
                                                                                                        name='searchType'
                                                                                                        id='searchType'
                                                                                                        value='project'/>
                                <ul id='searchTypeMenu' class='dropdown-menu'>
                                    <li><a href='javascript:$.setSearchType("bug");' data-value='bug'>Bug</a></li>
                                    <li><a href='javascript:$.setSearchType("story");' data-value='story'>需求</a></li>
                                    <li><a href='javascript:$.setSearchType("task");' data-value='task'>任务</a></li>
                                    <li><a href='javascript:$.setSearchType("testcase");' data-value='testcase'>用例</a>
                                    </li>
                                    <li class='selected'><a href='javascript:$.setSearchType("project");'
                                                            data-value='project'>项目</a></li>
                                    <li><a href='javascript:$.setSearchType("product");' data-value='product'>产品</a>
                                    </li>
                                    <li><a href='javascript:$.setSearchType("user");' data-value='user'>用户</a></li>
                                    <li><a href='javascript:$.setSearchType("build");' data-value='build'>版本</a></li>
                                    <li><a href='javascript:$.setSearchType("release");' data-value='release'>发布</a>
                                    </li>
                                    <li><a href='javascript:$.setSearchType("productplan");' data-value='productplan'>产品计划</a>
                                    </li>
                                    <li><a href='javascript:$.setSearchType("testtask");' data-value='testtask'>测试单</a>
                                    </li>
                                    <li><a href='javascript:$.setSearchType("doc");' data-value='doc'>文档</a></li>
                                    <li><a href='javascript:$.setSearchType("caselib");' data-value='caselib'>用例库</a>
                                    </li>
                                    <li><a href='javascript:$.setSearchType("testreport");'
                                           data-value='testreport'>测试报告</a></li>
                                </ul>
                            </div>
                            <input id='searchInput' class='form-control search-input' type='search'
                                   onclick='this.value=""' onkeydown='if(event.keyCode==13) $.gotoObject();'
                                   placeholder='编号(ctrl+g)'/></div>
                        <a href='javascript:$.gotoObject();' class='btn btn-link' id='searchGo'>GO!</a></div>
                    <ul id="userNav" class="nav nav-default">
                        <li><a class='dropdown-toggle' data-toggle='dropdown'><span class='user-name'>admin</span><span
                                class='caret'></span></a>
                            <ul class='dropdown-menu pull-right'>
                                <li class="user-profile-item"><a href='/temp/my-profile' class=' no-role'>
                                    <div class='avatar avatar bg-secondary avatar-circle'>A</div>
                                    <div class="user-profile-name">admin</div>
                                    <div class="user-profile-role"></div>
                                </a></li>
                                <li class="divider"></li>
                                <li><a href='/temp/my-profile'>个人档案</a>
                                </li>
                                <li><a href='/temp/my-changepassword' class='iframe' data-width='500'>更改密码</a>
                                </li>
                                <li class='divider'></li>
                                <li class='dropdown-submenu'><a href='javascript:;'>主题</a>
                                    <ul class='dropdown-menu pull-left'>
                                        <li class='selected'><a href='javascript:selectTheme("default");'
                                                                data-value='default'>禅道蓝（默认）</a></li>
                                        <li><a href='javascript:selectTheme("green");' data-value='green'>叶兰绿</a></li>
                                        <li><a href='javascript:selectTheme("red");' data-value='red'>赤诚红</a></li>
                                        <li><a href='javascript:selectTheme("purple");' data-value='purple'>玉烟紫</a></li>
                                        <li><a href='javascript:selectTheme("pink");' data-value='pink'>芙蕖粉</a></li>
                                        <li><a href='javascript:selectTheme("blackberry");'
                                               data-value='blackberry'>露莓黑</a></li>
                                        <li><a href='javascript:selectTheme("classic");' data-value='classic'>经典蓝</a>
                                        </li>
                                    </ul>
                                </li>
                                <li class='dropdown-submenu'><a href='javascript:;'>Language</a>
                                    <ul class='dropdown-menu pull-left'>
                                        <li class='selected'><a href='javascript:selectLang("zh-cn");'>简体</a></li>
                                        <li><a href='javascript:selectLang("zh-tw");'>繁體</a></li>
                                        <li><a href='javascript:selectLang("en");'>English</a></li>
                                        <li><a href='javascript:selectLang("de");'>Deutsch</a></li>
                                        <li><a href='javascript:selectLang("fr");'>Français</a></li>
                                        <li><a href='javascript:selectLang("vi");'>Tiếng Việt</a></li>
                                        <li><a href='javascript:selectLang("ja");'>日本語</a></li>
                                    </ul>
                                </li>
                                <li class='custom-item'><a href='custom-ajaxMenu-project-index.html?onlybody=yes'
                                                           data-toggle='modal' data-type='iframe' data-icon='cog'
                                                           data-width='80%'>自定义导航</a></li>
                                <li class="divider"></li>
                                <li class='dropdown-submenu'><a data-toggle='dropdown'>帮助</a>
                                    <ul class='dropdown-menu pull-left'>
                                        <li><a href='tutorial-start.html' class='iframe' data-class-name='modal-inverse'
                                               data-width='800' data-headerless='true' data-backdrop='true'
                                               data-keyboard='true'>新手教程</a>
                                        </li>
                                        <li><a href='https://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao'
                                               class='open-help-tab' target='_blank' rel='noopener noreferrer'>手册</a>
                                        </li>
                                        <li><a href='/temp/misc-changeLog' class='iframe' data-width='800'
                                               data-headerless='true' data-backdrop='true' data-keyboard='true'>修改日志</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a href='/temp/misc-about' class='about iframe' data-width='1050'
                                       data-headerless='true' data-backdrop='true' data-keyboard='true'
                                       data-class='modal-about'>关于禅道</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href='/temp/user-logout'>退出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div id='subHeader'>
        <div class='container'>
            <div id="pageNav" class='btn-toolbar'>
                <div class="btn-group angle-btn">
                    <div class="btn-group">
                        <button data-toggle="dropdown" type="button" class="btn">项目主页 <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li><a href='/zentao/project-index-no.html'><i class="icon icon-home"></i> 项目主页</a>
                            </li>
                            <li><a href='/zentao/project-all-all.html'><i class="icon icon-cards-view"></i> 所有项目</a>
                            </li>
                            <li><a href='/zentao/project-create.html'><i class="icon icon-plus"></i> 添加项目</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class='btn-group angle-btn'>
                    <div class='btn-group'>
                        <button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='测试1'>
                            测试1 <span class='caret'></span></button>
                        <div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'
                             data-url='/zentao/project-ajaxGetDropMenu-2-project-task-unclosed.html'>
                            <div class="input-control search-box has-icon-left has-icon-right search-example"><input
                                    type="search" class="form-control search-input"/><label
                                    class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a
                                    class="input-control-icon-right search-clear-btn"><i
                                    class="icon icon-close icon-sm"></i></a></div>
                        </div>
                    </div>
                </div>
            </div>
            <nav id='subNavbar'>
                <ul class='nav nav-default'>
                    <li class=' active' data-id='task'><a href='/zentao/project-task-2.html'>任务</a>
                    </li>
                    <li class=' ' data-id='kanban'><a href='/zentao/project-kanban-2.html'>看板</a>
                    </li>
                    <li class=' ' data-id='burn'><a href='/zentao/project-burn-2.html'>燃尽图</a>
                    </li>
                    <li class='dropdown dropdown-hover ' data-id='list'><a
                            href='/zentao/project-grouptask-2.html'>更多<span class='caret'></span></a>
                        <ul class='dropdown-menu'>
                            <li class='' data-id='groupTask'><a href='/zentao/project-groupTask-2.html'>分组视图</a>
                            </li>
                            <li class='' data-id='tree'><a href='/zentao/project-tree-2.html'>树状图</a>
                            </li>
                        </ul>
                    </li>
                    <li class='divider'></li>
                    <li class=' ' data-id='story'><a href='/zentao/project-story-2.html'>需求</a>
                    </li>
                    <li class='dropdown dropdown-hover ' data-id='qa'><a href='/zentao/project-bug-2.html'>测试<span
                            class='caret'></span></a>
                        <ul class='dropdown-menu'>
                            <li class='' data-id='bug'><a href='/zentao/project-bug-2.html'>Bug</a>
                            </li>
                            <li class='' data-id='build'><a href='/zentao/project-build-2.html'>版本</a>
                            </li>
                            <li class='' data-id='testtask'><a href='/zentao/project-testtask-2.html'>测试单</a>
                            </li>
                        </ul>
                    </li>
                    <li class=' ' data-id='doc'><a href='/zentao/doc-objectLibs-project-2-project.html'>文档</a>
                    </li>
                    <li class='divider'></li>
                    <li class=' ' data-id='team'><a href='/zentao/project-team-2.html'>团队</a>
                    </li>
                    <li class='dropdown dropdown-hover ' data-id='action'><a
                            href='/zentao/project-dynamic-2.html'>动态</a>
                    </li>
                    <li class='divider'></li>
                    <li class=' ' data-id='product'><a href='/zentao/project-manageproducts-2.html'>产品</a>
                    </li>
                    <li class=' ' data-id='view'><a href='/zentao/project-view-2.html'>概况</a>
                    </li>
                </ul>
            </nav>
            <div id="pageActions">
                <div class='btn-toolbar'></div>
            </div>
        </div>
    </div>
</header>

<main id='main'>
    <div class='container'>
        <style>
            #setShowModule {
                margin-left: 30px;
            }
        </style>
        <script>
            $(function () {
                $('#sidebar .cell .text-center:last').append("<a href='#showModuleModal' data-toggle='modal' class='btn btn-info btn-wide'>模块设置</a><hr class='space-sm' />");

                var addSettingButton = function () {
                    var $btnToolbar = $('#main .table-header .btn-toolbar:first');
                    if ($btnToolbar.length > 0) {
                        var $dropdown = $('<div class="dropdown"><button id="tableCustomBtn" type="button" class="btn btn-link" data-toggle="dropdown"><i class="icon-cog"></i></button></div>');
                        var $dropmenu = $('<ul class="dropdown-menu pull-right"></ul>');
                        $dropmenu.append("<li><a href='/zentao/datatable-ajaxCustom-project-task.html' data-toggle='modal' data-type='ajax'>自定义列</a></li>");
                        $dropmenu.append("<li><a href='javascript:saveDatatableConfig(\"mode\", \"datatable\", true);' id='switchToDatatable'>切换到高级表格</a></li>");
                        $dropdown.append($dropmenu).appendTo($btnToolbar);
                    }
                };
                $('#main .main-table').on('tableReload', addSettingButton);
                addSettingButton();

                $('#setShowModule').click(function () {
                    if ('admin' == 'guest') return;
                    datatableId = 'projectTask';
                    var value = $('#showModuleModal input[name="showModule"]:checked').val();
                    var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
                    if (typeof allModule === 'undefined') allModule = false;
                    $.ajax(
                        {
                            type: "POST",
                            dataType: 'json',
                            data:
                                {
                                    target: datatableId,
                                    name: 'showModule',
                                    value: value,
                                    allModule: allModule,
                                },
                            success: function () {
                                window.location.reload();
                            },
                            url: '/zentao/datatable-ajaxSave.html'
                        });
                });

                window.saveDatatableConfig = function (name, value, reload, global) {
                    if ('admin' == 'guest') return;
                    var datatableId = 'projectTask';
                    if (typeof value === 'object') value = JSON.stringify(value);
                    if (typeof global === 'undefined') global = 0;
                    $.ajax(
                        {
                            type: "POST",
                            dataType: 'json',
                            data: {target: datatableId, name: name, value: value, global: global},
                            success: function (e) {
                                if (reload) window.location.reload();
                            },
                            url: '/zentao/datatable-ajaxSave.html'
                        });
                    $.get(createLink('score', 'ajax', "method=switchToDataTable"));
                };
            });
        </script>

        <div class="modal fade" id="showModuleModal" tabindex="-1" role="dialog">
            <div class="modal-dialog w-600px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><i class="icon icon-close"></i>
                        </button>
                        <h4 class="modal-title"><i class="icon-cog"></i> 模块设置</h4>
                    </div>
                    <div class="modal-body">
                        <form class='form-condensed' method='post' target='hiddenwin'
                              action='/zentao/datatable-ajaxSave.html'>
                            <table class='table table-form'>
                                <tr>
                                    <td class='w-150px'>列表页是否显示模块名</td>
                                    <td><label class='radio-inline'><input type='radio' name='showModule' value='0'
                                                                           checked='checked' id='showModule0'/>
                                        不显示</label><label class='radio-inline'><input type='radio' name='showModule'
                                                                                      value='base' id='showModulebase'/>
                                        只显示一级模块</label><label class='radio-inline'><input type='radio' name='showModule'
                                                                                          value='end'
                                                                                          id='showModuleend'/> 只显示最后一级模块</label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>是否显示完整产品模块</td>
                                    <td><label class='radio-inline'><input type='radio' name='showAllModule' value='0'
                                                                           checked='checked' id='showAllModule0'/>
                                        不显示</label><label class='radio-inline'><input type='radio' name='showAllModule'
                                                                                      value='1' id='showAllModule1'/> 显示</label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='2' class='text-center'>
                                        <button type='button' id='setShowModule' class='btn btn-primary'>保存</button>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <script>moduleID = 0;</script>
        <script>productID = 0;</script>
        <script>projectID = 2;</script>
        <script>browseType = "unclosed";</script>
        <script>unfoldTasks = [];</script>
        <script>unfoldAll = "\u5168\u90e8\u5c55\u5f00";</script>
        <script>foldAll = "\u5168\u90e8\u6298\u53e0";</script>
        <div id="mainMenu" class="clearfix">
            <div id="sidebarHeader">
                <div class="title">
                    所有模块
                </div>
            </div>
            <div class="btn-toolbar pull-left">
                <a href='/zentao/project-task-2-all.html' id='all' class='btn btn-link '><span
                        class='text'>所有</span></a>
                <a href='/zentao/project-task-2-unclosed.html' id='unclosed' class='btn btn-link btn-active-text'><span
                        class='text'>未关闭</span> <span class='label label-light label-badge'>1</span></a>
                <a href='/zentao/project-task-2-assignedtome.html' id='assignedtome' class='btn btn-link '><span
                        class='text'>指派给我</span></a>
                <a href='/zentao/project-task-2-myinvolved.html' id='myinvolved' class='btn btn-link '><span
                        class='text'>由我参与</span></a>
                <a href='/zentao/project-task-2-delayed.html' id='delayed' class='btn btn-link '><span
                        class='text'>已延期</span></a>
                <a href='/zentao/project-task-2-needconfirm.html' id='needconfirm' class='btn btn-link '
                   title='需求变更'><span class='text'>需求变更</span></a>
                <div class='btn-group' id='more'><a href='javascript:;' data-toggle='dropdown' class='btn btn-link '>更多
                    <span class='caret'></span></a>
                    <ul class='dropdown-menu'>
                        <li><a href='/zentao/project-task-2-wait.html'>未开始</a>
                        <li><a href='/zentao/project-task-2-doing.html'>进行中</a>
                        <li><a href='/zentao/project-task-2-undone.html'>未完成</a>
                        <li><a href='/zentao/project-task-2-finishedbyme.html'>我完成</a>
                        <li><a href='/zentao/project-task-2-done.html'>已完成</a>
                        <li><a href='/zentao/project-task-2-closed.html'>已关闭</a>
                        <li><a href='/zentao/project-task-2-cancel.html'>已取消</a>
                    </ul>
                </div>
                <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> 搜索</a>
            </div>
            <div class="btn-toolbar pull-right">
                <a href='/zentao/task-report-2-unclosed.html' class='btn btn-link '><i
                        class='icon-common-report icon-bar-chart muted'></i> <span class='text'>报表</span></a>

                <div class="btn-group dropdown-hover">
                    <button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-export muted"></i> <span
                            class="text">导出</span> <span class="caret"></span></button>
                    <ul class="dropdown-menu pull-right" id='exportActionMenu'>
                        <li><a href='/zentao/task-export-2-id_desc-unclosed.html' class='export'>导出数据</a>
                        </li>
                    </ul>
                </div>

                <div class="btn-group dropdown-hover">
                    <button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-import muted"></i> <span
                            class="text">导入</span> <span class="caret"></span></button>
                    <ul class="dropdown-menu pull-right" id='importActionMenu'>
                        <li><a href='/zentao/project-importTask-2.html' class='import'>转入任务</a>
                        </li>
                        <li><a href='/zentao/project-importBug-2.html' class='import'>导入Bug</a>
                        </li>
                    </ul>
                </div>
                <a href='/zentao/task-batchCreate-2--0.html' class='btn btn btn-secondary'><i
                        class='icon icon-plus'></i> 批量创建</a>
                <a href='/zentao/task-create-2-0-0.html' class='btn btn-primary'><i class='icon icon-plus'></i> 建任务</a>
            </div>
        </div>
        <div id="mainContent" class="main-row fade">
            <div class="side-col" id="sidebar">
                <div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
                <div class="cell">
                    <div class="text-center">
                        <a href='/zentao/tree-browsetask-2-0.html' class='btn btn-info btn-wide'>维护模块</a>
                        <hr class="space-sm"/>
                    </div>
                </div>
            </div>
            <div class="main-col">
                <div class="cell" id="queryBox" data-module='task'></div>
                <form class="main-table table-task skip-iframe-modal" method="post" id='projectTaskForm'>
                    <div class="table-header fixed-right">
                        <nav class="btn-toolbar pull-right"></nav>
                    </div>
                    <div class="table-responsive">
                        <table class='table has-sort-head' id='taskList' data-fixed-left-width='550' data-fixed-right-width='180'>
                            <thead>
                                <tr>
                                    <th data-flex='false' data-width='90px' style='width:90px' class='c-id ' title='ID'>
                                        <div class='checkbox-primary check-all' title='全选'><label></label></div>
                                        <a href='/zentao/project-task-2-unclosed-0-id_asc-1-100.html' class='sort-down'>ID</a>
                                    </th>
                                    <th data-flex='false' data-width='50px' style='width:50px' class='c-pri ' title='P'><a href='/zentao/project-task-2-unclosed-0-pri_asc-1-100.html' class='header'>P</a></th>
                                    <th data-flex='false' data-width='auto' style='width:auto' class='c-name ' title='任务名称'>
                                        <a href='/zentao/project-task-2-unclosed-0-name_asc-1-100.html' class='header'>任务名称</a>
                                    </th>
                                    <th data-flex='true' data-width='80px' style='width:80px' class='c-status ' title='状态'>
                                        <a href='/zentao/project-task-2-unclosed-0-status_asc-1-100.html' class='header'>状态</a>
                                    </th>
                                    <th data-flex='true' data-width='100px' style='width:100px' class='c-assignedTo '
                                        title='指派给'><a href='/zentao/project-task-2-unclosed-0-assignedTo_asc-1-100.html'
                                                       class='header'>指派给</a>
                                    </th>
                                    <th data-flex='true' data-width='80px' style='width:80px' class='c-finishedBy '
                                        title='完成者'><a href='/zentao/project-task-2-unclosed-0-finishedBy_asc-1-100.html'
                                                       class='header'>完成者</a>
                                    </th>
                                    <th data-flex='true' data-width='80px' style='width:80px' class='c-estimate '
                                        title='预计'><a href='/zentao/project-task-2-unclosed-0-estimate_asc-1-100.html'
                                                      class='header'>预计</a>
                                    </th>
                                    <th data-flex='true' data-width='80px' style='width:80px' class='c-consumed '
                                        title='消耗'><a href='/zentao/project-task-2-unclosed-0-consumed_asc-1-100.html'
                                                      class='header'>消耗</a>
                                    </th>
                                    <th data-flex='true' data-width='70px' style='width:70px' class='c-left ' title='剩余'><a
                                            href='/zentao/project-task-2-unclosed-0-left_asc-1-100.html'
                                            class='header'>剩余</a></th>
                                    <th data-flex='true' data-width='50px' style='width:50px' class='c-progress text-center'
                                        title='进度'>进度
                                    </th>
                                    <th data-flex='true' data-width='100px' style='width:100px' class='c-deadline '
                                        title='截止'><a href='/zentao/project-task-2-unclosed-0-deadline_asc-1-100.html'
                                                      class='header'>截止</a>
                                    </th>
                                    <th data-flex='false' data-width='180px' style='width:180px'
                                    class='c-actions text-center' title='操作'>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr data-id='1' data-status='wait' data-estimate='0' data-consumed='0' data-left='0'>
                                <td class='c-id cell-id'>
                                    <div class='checkbox-primary'><input type='checkbox' name='taskIDList[]' value='1' id='taskIDList1'/> <label for='taskIDList1'></label></div>
                                    <a href='/zentao/task-view-1.html'>001</a>
                                </td>
                                <td class='c-pri'><span class='label-pri label-pri-3' title='3'>3</span></td>
                                <td class='c-name text-left' title='第一个任务'><a href='/zentao/task-view-1.html' style='color:#0b76cc'>第一个任务</a></td>
                                <td class='c-status task-wait'><span class='status-task status-wait'> 未开始</span></td>
                                <td class='c-assignedTo has-btn text-left'><a href='/zentao/task-assignTo-2-1.html?onlybody=yes' class='iframe btn btn-icon-left btn-sm '><i class='icon icon-hand-right'></i><span title='' class='text-primary'>未指派</span></a></td>
                                <td class='c-finishedBy'></td>
                                <td class='c-estimate'>0</td>
                                <td class='c-consumed'>0</td>
                                <td class='c-left'>0</td>
                                <td class='c-progress text-right'>0%</td>
                                <td class='c-deadline text-center'></td>
                                <td class='c-actions'>
                                    <a href='/zentao/task-start-1.html?onlybody=yes' class='btn iframe' title='开始'>
                                        <i class='icon-task-start icon-play'></i>
                                    </a>
                                    <button type='button' class='disabled btn iframe'>
                                        <i class='icon-task-close disabled icon-off' title='关闭'></i>
                                    </button>
                                    <a href='/zentao/task-finish-1.html?onlybody=yes' class='btn iframe' title='完成'>
                                        <i class='icon-task-finish icon-checked'></i>
                                    </a>
                                    <a href='/zentao/task-recordEstimate-1.html?onlybody=yes' class='btn iframe' title='工时'>
                                        <i class='icon-task-recordEstimate icon-time'></i>
                                    </a>
                                    <a href='/zentao/task-edit-1.html' class='btn ' title='编辑任务'>
                                        <i class='icon-common-edit icon-edit'></i>
                                    </a>
                                    <a href='/zentao/task-batchCreate-2-0-0-1-0.html' class='btn ' title='子任务'>
                                        <i class='icon-task-batchCreate icon-treemap-alt'></i>
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="table-footer">
                        <div class="checkbox-primary check-all"><label>全选</label></div>
                        <div class="table-actions btn-toolbar">
                            <div class='btn-group dropup'>
                                <button type='button' class='btn' data-form-action='/zentao/task-batchEdit-2.html'>编辑
                                </button>
                                <button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span
                                        class='caret'></span></button>
                                <ul class='dropdown-menu'>
                                    <li><a href='#'
                                           onclick="setFormAction('/zentao/task-batchClose.html', 'hiddenwin', '#taskList')">关闭</a>
                                    </li>
                                    <li><a href='#'
                                           onclick="setFormAction('/zentao/task-batchCancel.html', 'hiddenwin', '#taskList')">取消</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="btn-group dropup">
                                <button data-toggle="dropdown" type="button" class="btn">模块 <span class="caret"></span>
                                </button>
                                <div class="dropdown-menu search-list">
                                    <div class="list-group">
                                        <a href='#'
                                           onclick="setFormAction('/zentao/task-batchChangeModule-0.html', 'hiddenwin', '#taskList')">/</a>
                                    </div>
                                </div>
                            </div>

                            <div class="btn-group dropup">
                                <button data-toggle="dropdown" type="button" class="btn">指派给 <span class="caret"></span>
                                </button>
                                <select name='assignedTo' id='assignedTo' class="hidden">
                                    <option value='admin' title='admin' data-keys='admin a'>admin</option>
                                </select>
                                <div class="dropdown-menu search-list">
                                    <div class="list-group">
                                        <a href='javascript:$(".table-actions #assignedTo").val("admin");setFormAction("/zentao/task-batchAssignTo-2.html", "hiddenwin", "#taskList")'
                                           data-key='@admin'>admin</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="table-statistic">本页共 <strong>1</strong> 个任务，未开始 <strong>1</strong>，进行中
                            <strong>0</strong>，总预计 <strong>0</strong> 工时，已消耗 <strong>0</strong> 工时，剩余 <strong>0</strong>
                            工时。
                        </div>
                        <ul class='pager' data-page-cookie='pagerProjectTask' data-ride='pager' data-rec-total='1'
                            data-rec-per-page='100' data-page='1'
                            data-link-creator='/zentao/project-task-2-unclosed-0--1-{recPerPage}-{page}.html'></ul>
                    </div>
                </form>
            </div>
        </div>
        <script>replaceID = "taskList";</script>
        <script>
            $(function () {
                // Update table summary text
                var checkedSummary = '选中 <strong>%total%</strong> 个任务，未开始 <strong>%wait%</strong>，进行中 <strong>%doing%</strong>，总预计 <strong>%estimate%</strong> 工时，已消耗 <strong>%consumed%</strong> 工时，剩余 <strong>%left%</strong> 工时。';
                var pageSummary = '本页共 <strong>%total%</strong> 个任务，未开始 <strong>%wait%</strong>，进行中 <strong>%doing%</strong>，总预计 <strong>%estimate%</strong> 工时，已消耗 <strong>%consumed%</strong> 工时，剩余 <strong>%left%</strong> 工时。';
                $('#projectTaskForm').table(
                    {
                        statisticCreator: function (table) {
                            var $table = table.getTable();
                            var $checkedRows = $table.find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
                            var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
                            var checkedTotal = $checkedRows.length;
                            var $rows = checkedTotal ? $checkedRows : $table.find(table.isDataTable ? '.datatable-rows .datatable-row-left' : 'tbody>tr');

                            var checkedWait = 0;
                            var checkedDoing = 0;
                            var checkedEstimate = 0;
                            var checkedConsumed = 0;
                            var checkedLeft = 0;
                            var taskIdList = [];
                            $rows.each(function () {
                                var $row = $(this);
                                if ($originTable) {
                                    $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
                                }
                                var data = $row.data();
                                taskIdList.push(data.id);

                                var status = data.status;
                                if (status === 'wait') checkedWait++;
                                if (status === 'doing') checkedDoing++;

                                var canStatistics = false;
                                if (!$row.hasClass('table-children')) {
                                    canStatistics = true;
                                } else {
                                    /* Fix bug #2579. When only child task is checked then statistics it. */
                                    var parentID = 0;
                                    var classes = $row.attr('class').split(' ');
                                    for (i in classes) {
                                        if (classes[i].indexOf('parent-') >= 0) parentID = classes[i].replace('parent-', '');
                                    }

                                    if (parentID && taskIdList.indexOf(parseInt(parentID)) < 0) canStatistics = true;
                                }

                                if (canStatistics) {
                                    checkedEstimate += Number(data.estimate);
                                    checkedConsumed += Number(data.consumed);
                                    if (status != 'cancel' && status != 'closed') checkedLeft += Number(data.left);
                                }
                            });
                            return (checkedTotal ? checkedSummary : pageSummary).replace('%total%', $rows.length).replace('%wait%', checkedWait)
                                .replace('%doing%', checkedDoing)
                                .replace('%estimate%', checkedEstimate.toFixed(1))
                                .replace('%consumed%', checkedConsumed.toFixed(1))
                                .replace('%left%', checkedLeft.toFixed(1));
                        }
                    })
            });
        </script>
    </div>
    <script>
        $.initSidebar();
    </script>

    <iframe frameborder='0' name='hiddenwin' id='hiddenwin' scrolling='no' class='debugwin hidden'></iframe>
</main>
<footer id='footer'>
    <div class="container">
        <ul class='breadcrumb'>
            <li><a href='/zentao/my/'>禅道</a>
            </li>
            <li><a href='/zentao/project/'>项目</a>
            </li>
            <li class='active'><a href='/zentao/project-browse-2.html'>测试1</a>
            </li>
            <li class='active'>任务列表</li>
        </ul>
        <div id='poweredBy'>
            <small class='muted'><a href='https://api.zentao.net/goto.php?item=aiux' class='link-aiux' target='_blank'>Designed
                by <strong>艾体验</strong></a></small> &nbsp;
            <a href='https://www.zentao.net' target='_blank'><i class='icon-zentao'></i> 禅道12.5.3</a> &nbsp;
            <a href='https://api.zentao.net/goto.php?item=proversion&from=footer' target='_blank' id='proLink'
               class='text-important'>专业版 <i class='text-danger icon-pro-version'></i></a> &nbsp;
        </div>
    </div>
</footer>
<div id="noticeBox"></div>
<script>
    /* Alert got messages. */
    needPing = false;
    $(function () {
        var windowBlur = false;
        if (window.Notification) {
            window.onblur = function () {
                windowBlur = true;
            }
            window.onfocus = function () {
                windowBlur = false;
            }
        }
        setInterval(function () {
            $.get(createLink('message', 'ajaxGetMessage', "windowBlur=" + (windowBlur ? '1' : '0')), function (data) {
                if (!windowBlur) {
                    $('#noticeBox').append(data);
                    adjustNoticePosition();
                } else {
                    if (data) {
                        if (typeof data == 'string') data = $.parseJSON(data);
                        if (typeof data.message == 'string') notifyMessage(data);
                    }
                }
            });
        }, 300000);
    })

</script>

<script>function setWhite(acl) {
    acl == 'custom' ? $('#whitelistBox').removeClass('hidden') : $('#whitelistBox').addClass('hidden');
}

function switchStatus(projectID, status) {
    if (status) location.href = createLink('project', 'task', 'project=' + projectID + '&type=' + status);
}

function switchGroup(projectID, groupBy) {
    link = createLink('project', 'groupTask', 'project=' + projectID + '&groupBy=' + groupBy);
    location.href = link;
}

/**
 * Convert a date string like 2011-11-11 to date object in js.
 *
 * @param  string $date
 * @access public
 * @return date
 */
function convertStringToDate(dateString) {
    dateString = dateString.split('-');
    return new Date(dateString[0], dateString[1] - 1, dateString[2]);
}

/**
 * Compute delta of two days.
 *
 * @param  string $date1
 * @param  string $date1
 * @access public
 * @return int
 */
function computeDaysDelta(date1, date2) {
    date1 = convertStringToDate(date1);
    date2 = convertStringToDate(date2);
    delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1;

    weekEnds = 0;
    for (i = 0; i < delta; i++) {
        if ((weekend == 2 && date1.getDay() == 6) || date1.getDay() == 0) weekEnds++;
        date1 = date1.valueOf();
        date1 += 1000 * 60 * 60 * 24;
        date1 = new Date(date1);
    }
    return delta - weekEnds;
}

/**
 * Compute work days.
 *
 * @access public
 * @return void
 */
function computeWorkDays(currentID) {
    isBactchEdit = false;
    if (currentID) {
        index = currentID.replace('begins[', '');
        index = index.replace('ends[', '');
        index = index.replace(']', '');
        if (!isNaN(index)) isBactchEdit = true;
    }

    if (isBactchEdit) {
        beginDate = $('#begins\\[' + index + '\\]').val();
        endDate = $('#ends\\[' + index + '\\]').val();
    } else {
        beginDate = $('#begin').val();
        endDate = $('#end').val();
    }

    if (beginDate && endDate) {
        if (isBactchEdit) $('#dayses\\[' + index + '\\]').val(computeDaysDelta(beginDate, endDate));
        if (!isBactchEdit) $('#days').val(computeDaysDelta(beginDate, endDate));
    } else if ($('input[checked="true"]').val()) {
        computeEndDate();
    }
}

/**
 * Compute the end date for project.
 *
 * @param  int    $delta
 * @access public
 * @return void
 */
function computeEndDate(delta) {
    beginDate = $('#begin').val();
    if (!beginDate) return;

    delta = parseInt(delta);
    beginDate = convertStringToDate(beginDate);
    if ((delta == 7 || delta == 14) && (beginDate.getDay() == 1)) {
        delta = (weekend == 2) ? (delta - 2) : (delta - 1);
    }

    endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
    $('#end').val(endDate).datetimepicker('update');
    computeWorkDays();
}

/**
 * Load branches.
 *
 * @param  int $product
 * @access public
 * @return void
 */
function loadBranches(product) {
    $('#productsBox select').each(function () {
        var $product = $(product);
        if ($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id')) {
            alert(errorSameProducts);
            $product.val(0);
            $product.trigger("chosen:updated");
            return false;
        }
    });

    if ($('#productsBox .input-group:last select:first').val() != 0) {
        var length = $('#productsBox .input-group').size();
        $('#productsBox .row').append('<div class="col-sm-4">' + $('#productsBox .col-sm-4:last').html() + '</div>');
        if ($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove();
        $('#productsBox .input-group:last .chosen-container').remove();
        $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length);
        $('#productsBox .input-group:last .chosen').chosen();

        adjustProductBoxMargin();
    }

    var $inputgroup = $(product).closest('.input-group');
    if ($inputgroup.find('select').size() >= 2) $inputgroup.removeClass('has-branch').find('select:last').remove();
    if ($inputgroup.find('.chosen-container').size() >= 2) $inputgroup.find('.chosen-container:last').remove();

    var index = $inputgroup.find('select:first').attr('id').replace('products', '');
    $.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val()), function (data) {
        if (data) {
            $inputgroup.addClass('has-branch').append(data);
            $inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)").chosen();
        }
    });

    loadPlans(product);
}

function loadPlans(product, branchID) {
    if ($('#plansBox').size() == 0) return false;

    var productID = $(product).val();
    var branchID = typeof (branchID) == 'undefined' ? 0 : branchID;
    var index = $(product).attr('id').replace('products', '');

    if (productID != 0) {
        if (typeof (planID) == 'undefined') planID = 0;
        planID = $("select#plans" + productID).val() != '' ? $("select#plans" + productID).val() : planID;
        $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=' + ((config.currentMethod == 'create' || config.currentMethod == 'edit') ? 'unexpired' : '')), function (data) {
            if (data) {
                if ($("div#plan" + index).size() == 0) $("#plansBox .row").append('<div class="col-sm-4" id="plan' + index + '"></div>');
                $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + ']').attr('id', 'plans' + productID).chosen();

                adjustPlanBoxMargin();
            }
        });
    }
}

function adjustProductBoxMargin() {
    var productRows = Math.ceil($('#productsBox > .row > .col-sm-4').length / 3);
    if (productRows > 1) {
        for (i = 1; i <= productRows - 1; i++) {
            $('#productsBox .col-sm-4:lt(' + (i * 3) + ')').css('margin-bottom', '10px');
        }
    }
}

function adjustPlanBoxMargin() {
    var planRows = Math.ceil($('#plansBox > .row > .col-sm-4').length / 3);
    if (planRows > 1) {
        for (j = 1; j <= planRows - 1; j++) {
            $('#plansBox .col-sm-4:lt(' + (j * 3) + ')').css('margin-bottom', '10px');
        }
    }
}

function loadBranch() {
}

/* Auto compute the work days. */
$(function () {
    $(".date").bind('dateSelected', function () {
        computeWorkDays(this.id);
    })
});

$(function () {
    $(document).on('click', '.task-toggle', function (e) {
        var $toggle = $(this);
        var id = $(this).data('id');
        var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
        $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);

        e.stopPropagation();
        e.preventDefault();
    });

    adjustProductBoxMargin();
    adjustPlanBoxMargin();
});

$(function () {
    if ($('#taskList thead th.c-name').width() < 150) $('#taskList thead th.c-name').width(150);
    $('#taskList td.has-child .task-toggle').each(function () {
        var $td = $(this).closest('td');
        var labelWidth = 0;
        if ($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
        $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
    });

    toggleFold('#projectTaskForm', unfoldTasks, projectID, 'project');
});

$('#module' + moduleID).closest('li').addClass('active');

$('#product' + productID).closest('li').addClass('active');
</script>
</body>
</html>
